# -*- encoding: utf-8 -*-
#2.利用random的randint方法写一个猜数字的小游戏
a=1
while a<=9:
    b=1

    while b<=a:
        he = a * b
        print("%d*%d=%d"%(b,a,he),end=' ')
        b += 1
    print("%d"%a)
    a += 1

print("-------------------")

import random
f=5
number=random.randint(1,100)
while f>0:
    f -= 1
    shu = int(input("输入整数数字："))
    if number==shu:
        print('正确')
        break
    elif shu>=number:
        print('大了,你还有%d次机会'%f)
    elif shu<=number:
        print('小了，你还有%d次机会'%f)

print("猜词结束")
print("正确答案是%d"%number)